package com.alb;

import java.sql.Array;
import java.util.*;

public class RedBook1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n=scanner.nextInt();
        int k=scanner.nextInt();

        List<int[]> fans=new ArrayList<>();
        for (int i = 0; i < n; i++) {
            int x=scanner.nextInt();
            int y=scanner.nextInt();
            fans.add(new int[]{x*1+y*2,i+1});
        }
        Collections.sort(fans, new Comparator<int[]>() {
            @Override
            public int compare(int[] a, int[] b) {
                if(a[0]!=b[0]){
                    return Integer.compare(b[0],a[0]);
                }else{
                    return Integer.compare(a[1],b[1]);
                }
            }
        });

        List<Integer> selected=new ArrayList<>();
        for (int i = 0; i < k; i++) {
            selected.add(fans.get(i)[1]);
        }
        Collections.sort(selected);
        for (int i : selected) {
            System.out.println(i+" ");
        }

    }
}
